ul.breadcrumb.height37
	li
		a(href='/portal/index') 首页
	li.sep >
	li.cd
		a(href='#/fund') 基金
	li.sep >
	li.cd 财富管理计算器

aside.toolsLeftContainer.yui3-u.mright20
	.title.font14.nfc
		p 淘金工具
	ul.tools
		li(ng-class='{selectedItem : toolType == 3}')
			a.combination(href='#', onclick='return false;', ng-click='change(3);') 组合计算器
			.arrowLeft
		li(ng-class='{selectedItem : toolType == 4}')
			a.regular(href='#', onclick='return false;', ng-click='change(4);') 定投计算器
			.arrowLeft
		li(ng-class='{selectedItem : toolType == 5}')
			a.treasure(href='#', onclick='return false;', ng-click='change(5);') 财富管理计算器
			.arrowLeft
		li(ng-class='{selectedItem : toolType == 1}').firstItem
			a.myinvestment(href='#/my_investment', target='_blank').action-guard 我的自选
			.arrowLeft
		li(ng-class='{selectedItem : toolType == 2}')
			a.compare(href='#/fund/compare', target='_blank') 基金比较
			.arrowLeft

.toolsRightContainer.yui3-u(ng-switch='toolType')
	section.treasureCalculator.border(ng-controller='App.TreasureCalculator', ng-switch-when=5, ng-init="_fn='fn1'")
		.top
			.yui3-u.toolspng.cfglpng
			.yui3-u.pad20.nfc.font20 财富管理计算器
		.yui3-g.functions.mtop20
			.yui3-u-1-5
				.function(ng-class="{functionSelected : _fn=='fn1'}")
					a.function1(href='#', onclick='return false;', ng-click="_fn='fn1';data={};error={}")
						span.font12 计算到期的
						span.font14.b 目标总额
			.yui3-u-1-5
				.function(ng-class="{functionSelected : _fn=='fn2'}")
					a.function2(href='#', onclick='return false;', ng-click="_fn='fn2';data={};error={}")
						span.font12 计算
						span.font14.b 月定投金额
			.yui3-u-1-5
				.function(ng-class="{functionSelected : _fn=='fn3'}")
					a.function3(href='#', onclick='return false;', ng-click="_fn='fn3';data={};error={}")
						span.font12 计算达到目标的
						span.font14.b 年回报率
			.yui3-u-1-5
				.function(ng-class="{functionSelected : _fn=='fn4'}")
					a.function4(href='#', onclick='return false;', ng-click="_fn='fn4';data={};error={}")
						span.font12 计算目前需要的
						span.font14.b 初始数额
			.yui3-u-1-5
				.function(ng-class="{functionSelected : _fn=='fn5'}")
					a.function5(href='#', onclick='return false;', ng-click="_fn='fn5';data={};error={}")
						span.font12 计算
						span.font14.b 定投期数
		.yui3-g.userEditor.nfc(ng-init='_focus=0')
			.mbottom10
				.yui3-u-1-3.tar
					.label 目前拥有的初始额：
				.yui3-u-1-3
					input.input(type='text', ng-model='data.original', ng-disabled="_fn=='fn4'", ng-class="{disabled : _fn=='fn4', focus: _focus == 1}", gf-focus='_focus=1', gf-blur='_focus=0')
					.placeholder 初始额为0就是年金计算器
				.yui3-u-1-3
					.error-message.label(ng-show='error.original', ng-bind='error.original')

			.mbottom10
				.yui3-u-1-3.tar
					.label 月定投金额：
				.yui3-u-1-3
					input.input(type='text', ng-model='data.month', ng-disabled="_fn=='fn2'", ng-class="{disabled : _fn=='fn2', focus: _focus == 2}", gf-focus='_focus=2', gf-blur='_focus=2')
					.placeholder 年投入额为0就是复利计算器
				.yui3-u-1-3
					.error-message.label(ng-show='error.month', ng-bind='error.month')

			.mbottom10
				.yui3-u-1-3.tar
					.label 定投期数：
				.yui3-u-1-3
					input.input(type='text', ng-model='data.times', ng-disabled="_fn=='fn5'", ng-class="{disabled : _fn=='fn5', focus: _focus == 3}", gf-focus='_focus=3', gf-blur='_focus=3')
				.yui3-u-1-3
					.error-message.label(ng-show='error.times', ng-bind='error.times')

			.mbottom10
				.yui3-u-1-3.tar
					.label 年投资回报率（%）：
				.yui3-u-1-3
					input.input(type='text', ng-model='data.rate', ng-disabled="_fn=='fn3'", ng-class="{disabled : _fn=='fn3', focus: _focus == 4}", gf-focus='_focus=4', gf-blur='_focus=4')
				.yui3-u-1-3
					.error-message.label(ng-show='error.rate', ng-bind='error.rate')

			.mbottom20
				.yui3-u-1-3.tar
					.label 目标总额：
				.yui3-u-1-3
					input.input(type='text', ng-model='data.result', ng-disabled="_fn=='fn1'", ng-class="{disabled : _fn=='fn1', focus: _focus == 5}", gf-focus='_focus=5', gf-blur='_focus=0')
				.yui3-u-1-3
					.error-message.label(ng-show='error.result', ng-bind='error.result')

			.yui3-u-1-3
			.yui3-u-1-3
				button.confirm.mright10(ng-click='calculator[_fn]()', ng-disabled='!(data.original||data.month||data.times||data.rate||data.result)', ng-class='{reset: !(data.original||data.month||data.times||data.rate||data.result)}') 计&nbsp;算
				button.reset(ng-click='data={};error={}') 重&nbsp;置

	section(ng-controller='App.FundCalculator', ng-switch-when=4)
		.fundCalculator.border.nfc
			.top
				.yui3-u.toolspng.jjdtpng
				.yui3-u.pad20.nfc.font20 基金定投计算器
			.nfc(ng-init='_focus=0')
				.yui3-g
					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 基金代码：
						input.input(ng-model='param.stock_name', placeholder='代码/名称', type='search', gf-textsearch='#demoFund', focus-cls='lbc blurborder focus', autocomplete='off', line-height='20')
						dl#demoFund.resultPanel.w220(ng-show='__show')
							dd(ng-repeat='pro in products.fund')
								a(href='#', onclick='return false;', hidefocus="true", ng-click='$parent.param.stock_name = pro[0];$parent.param.stock_code = pro[2];')
									span(ng-bind-html-unsafe='pro[0]+pro[2] | highlight : param.stock_name : "highlight b"')
							
					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 每期定投金额：
						input.input(ng-model='param.money', ng-class='{focus: _focus == 2}', gf-focus='_focus=2', gf-blur='_focus=0')

				.yui3-g.mtop10
					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 定投开始日：
						input.input(gf-date, readonly, ng-model='param.begin_date', ng-class='{focus: _focus == 3}', gf-focus='_focus=3', gf-blur='_focus=0')

					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 定投结束日：
						input.input(gf-date, readonly, ng-model='param.end_date', ng-class='{focus: _focus == 4}', gf-focus='_focus=4', gf-blur='_focus=0')

				.yui3-g.mtop10
					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 申购费率：
						input.input(ng-model='param.fee_rate_buy', ng-class='{focus: _focus == 5}', gf-focus='_focus=5', gf-blur='_focus=0')
						.ib %

					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 赎回费率：
						input.input(ng-model='param.fee_rate_sell', ng-class='{focus: _focus == 6}', gf-focus='_focus=6', gf-blur='_focus=0')
						.ib %

				.yui3-g.mtop10
					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 分红方式：
						.info.ib
							input.mright5(id='cashDividend', type='radio', name='dividend', ng-model='param.abonus_type', value=0)
							label.mright20(for='cashDividend') 现金分红
							input.mright5(id='dividendSpend', type='radio', name='dividend', ng-model='param.abonus_type', value=1)
							label(for='dividendSpend') 红利再投

					.editorItem.yui3-u-1-2
						.name.ib
							span.required *
							| 购买方式：
						.info.ib
							input.mright5(id='frontendCharge', type='radio', name='charge', ng-model='param.fee_type', value=0)
							label.mright20(for='frontendCharge') 前端收费
							input.mright5(id='backendCharge', type='radio', name='charge', ng-model='param.fee_type', value=1)
							label(for='backendCharge') 后端收费

				.tac.mtop10
					.error-message.label(ng-show='errorTip', ng-bind='errorTip')

			.padleft45.padright50(ng-class='{mtop60: !errorTip, mtop25: errorTip}')
				.btopdotted

			.editorItem.tac.mtop20.mbottom40
				button.confirm(href='#', onclick='return false;', ng-click='calculate()') 计&nbsp;算

		.mtop15.border.nfc(ng-init='tab=1')
			nav.tabheader.font14
				.tabItem.ib.tac(ng-class='{currentItem: tab == 1}', ng-click='tab=1') 定投明细
				.tabItem.ib.tac(ng-class='{currentItem: tab == 2}', ng-click='tab=2') 赎回汇总
				.tabItem.ib.tac(ng-class='{currentItem: tab == 3}', ng-click='tab=3') 收益汇总
				.tabItem.ib.tac(ng-class='{currentItem: tab == 4}', ng-click='tab=4') 分红拆分明细

			.mtop10
				.pad20(ng-switch='tab')
					table.table(ng-switch-when=1, ng-switch='datas.detail_list && datas.detail_list.length > 0')
						thead.thead.tac.vam.font14
							tr
								td 投入本金
								td 定投日期
								td 当天净值
								td 购得份额
								td 累计份额
								td 收益率

						tbody(ng-switch-default)
							tr
								td(colspan=6, align='center') 暂无数据

						tbody.tbody(ng-switch-when='true')
							tr(ng-repeat='item in datas.detail_list', ng-class-even="'even'")
								td(ng-bind='item.money')
								td(ng-bind='item.init_date | datehyphen')
								td(ng-bind='item.last_price | number : 4')
								td(ng-bind='item.buy_amount | number : 2')
								td(ng-bind='item.sum_amount | number : 2')
								td(ng-bind='item.profit_rate | percentage')

					table.table(ng-switch-when=2)
						thead.thead.tac.vam.font14
							tr
								td 当前市值(元)
								td 赎回日期
								td 赎回价格(元)
								td 赎回份额(份)
								td 赎回费用(元)

						tbody(ng-switch='!datas.data.init_date')
							tr(ng-switch-default)
								td(colspan=5, align='center') 暂无数据

							tr(ng-switch-when='false')
								td(ng-bind='datas.data.market_value | number : 2')
								td(ng-bind='datas.data.init_date | datehyphen')
								td(ng-bind='datas.data.last_price | number : 4')
								td(ng-bind='datas.data.sum_amount | number : 2')
								td(ng-bind='datas.data.sell_fee | number : 2')

					table.table(ng-switch-when=3)
						thead.thead.tac.vam.font14
							tr
								td 赎回所得(元)
								td 累计红利(元)
								td 累计转投(份)
								td 定投总收益(元)
								td 定投总收益率

						tbody(ng-switch='!datas.data.init_date')
							tr(ng-switch-default)
								td(colspan=5, align='center') 暂无数据

							tr(ng-switch-when='false')
								td(ng-bind='datas.data.sell_balance | number : 2')
								td(ng-bind='datas.data.sum_abonus | number : 1')
								td(ng-bind='datas.data.sum_abonus_pt | number : 2')
								td(ng-bind='datas.data.profit | number : 2')
								td(ng-bind='datas.data.profit_rate | percentage')

					table.table(ng-switch-when=4, ng-switch='datas.abonus_list && datas.abonus_list.length > 0')
						thead.thead.tac.vam.font14
							tr
								td 日期
								td 分红(或拆分比例)
								td 参与份额(份)
								td 现金分红(元)
								td 转投(份)

						tbody(ng-switch-default)
							tr
								td(colspan=5, align='center') 暂无数据

						tbody.tbody(ng-switch-when='true')
							tr(ng-repeat='item in datas.abonus_list', ng-class-even="'even'")
								td(ng-bind='item.init_date | datehyphen')
								td(ng-bind='item.abonus_rate')
								td(ng-bind='item.sum_amount | number : 2')
								td(ng-bind='item.abonus | number : 1')
								td(ng-bind='item.pt_amount | number : 2')

	options = [{type: 'stocks', name: '股票'}, {type: 'fund', name: '基金'}]
	section(ng-controller='App.CombinationCalculator', ng-switch-when=3)
		.combinationCalculator.border.nfc
			.top
				.yui3-u.toolspng.zuhepng
				.yui3-u.pad20.nfc.font20 组合计算器
			.title
				.yui3-u.img
					.toolspng.pic_5
				.yui3-u.t
					.toolspng.pic_12.tac
						b.font14 选择投资品
			.yui3-g
				.relative
					.yui3-u.pie(gf-chart='pieData', gf-pie)
				.yui3-u.selectone
					.container.bleft
						.list
							.inner(ng-init="arr=[0, 1]")
								.yui3-g.floor(ng-repeat='a in arr', ng-controller='App.CombinationCtrl', ng-init="1>=$index&&(ratio=50);")
									.yui3-u.w65.tac.name 投资品{{$index+1}}
									.yui3-u.w258
										.padleft5.padright5.padtop8
											.yui3-u.combobox(ng-init="i=1;")
												a(href='#', onclick='return false;', hidefocus="true", gf-textsearch='#select{{a}}', gf-value='type', line-height='18', offset='-2').nostyle.yui3-u
													.newlabel.tac.cp
														span.vam.padright15(ng-bind="options[type]")
														.yui3-u.toolspng.pic_6.vam
												dl.resultPanel.w70(id='select{{a}}')
													each t, ii in options
														dd
															a(href='#', onclick='return false;', hidefocus="true", ng-click="i=#{ii+1};type!='#{t.type}'&&(q='');type='#{t.type}'")= t.name

												.yui3-u
													input.newinput(placeholder='代码/名称', type='search', ng-model='q', gf-textsearch='#demo{{a}}', focus-cls='lbc blurborder focus', autocomplete='off', line-height='18', offset='-2')
													dl.resultPanel(id='demo{{a}}', ng-show='products[type] && products[type].length')
														dd(ng-repeat='pro in products[type]')
															a(href='#', onclick='return false;', hidefocus="true", ng-click='$parent.q = pro[0];$parent.product = pro;drawPie();')
																span(ng-bind-html-unsafe='pro[0]+pro[i] | highlight : q : "highlight b"')

											.yui3-u.toolspng.pic_16.cp.mtop8.mleft5(ng-show='1<$index', ng-click='arr.splice($index, 1);')

									.yui3-u.w65
										.bleft.tac.name 投资比例
									.yui3-u.w68
										.padleft5.padright5.padtop8
											.combobox
												.yui3-u-3-5
													input.newinput.ratio.tac(ng-model="ratio", gf-blur='drawPie();')
												.yui3-u-2-5(ng-show='!!ratio') %
								
								.yui3-g.floor.last
									.yui3-u.w323.tar
										span.padright10.ec(ng-show='proerror') (请至少添加2个投资品)
										span.padright10.ec(ng-show='arr.length>3') (可选投资品不超过4个)
										.yui3-u.toolspng.pic_8.vam 
										a(href='#', onclick='return false;', hidefocus="true", ng-click='arr.length < 4 && arr.push(arr.slice(-1)+1);').yui3-u.cp.add.padleft5.padright8.vam.nostyle 添加
									.yui3-u.w133
										.bleft.padleft15 总比例&nbsp;100%
						p.padleft25
							| 1.投资组合分析可查看您构建的投资组合的业绩、资产配置等内容。
							br
							| 2.您所构建组合的比例之和须为100%。

			.title
				.yui3-u.img
					.toolspng.pic_5
				.yui3-u.t
					.toolspng.pic_13.tac
						b.font14 选择参考标的(可多选)
				.yui3-u.padleft10(ng-show='biaodierror')
					.error-message 至少选择一项标的

			.yui3-g.selectone
				.container.bleft
					.referance
						.yui3-u-7-24(ng-init="index=0;")
							a(href='#', onclick='return false;', hidefocus="true", ng-init="temp=1;cls='pic_9'").yui3-u.toolspng.vam.mleft25.mright10(ng-class='cls', ng-click="temp=1-temp;cls='pic_'+(temp+9);selectBiaodi(0, index, !temp);")
							.yui3-u.selectbox.w102
								a(href='#', onclick='return false;', hidefocus="true", gf-textsearch='#select6', gf-value='inc[index]', line-height='12', offset='-2').nostyle
									.yui3-u-19-24.padleft5.vam(ng-bind='inc[index].name')
									.yui3-u-5-24.toolspng.pic_6.vam
								dl#select6.resultPanel(style='min-width: 102px;')
									dd(ng-repeat='n in inc')
										a(href='#', onclick='return false;', hidefocus="true", ng-click="$parent.index=$index;selectBiaodi(0, index, !temp);", ng-bind='n.name')

						.yui3-u-17-24(ng-controller='App.CombinationCtrl')
							a(href='#', onclick='return false;', hidefocus="true", ng-init="temp=1;cls='pic_10';").yui3-u.toolspng.vam.mleft25.mright10(ng-class='cls', ng-click="temp=1-temp;cls='pic_'+(temp+9);selectBiaodi(1, product, !temp);")
							.yui3-u.combobox(ng-init="i=1;")
								a(href='#', onclick='return false;', hidefocus="true", gf-textsearch='#select5', gf-value='{{type}}', line-height='18', offset='-2').nostyle.yui3-u
									.newlabel.tac.cp
										span.vam.padright15(ng-bind='options[type]')
										.yui3-u.toolspng.pic_6.vam
								- options.push({type: 'inc', name: '指数'})
								dl#select5.resultPanel.yui3-u-1.w70
									each t, ii in options
										dd
											a(href='#', onclick='return false;', hidefocus="true", ng-click="i=#{ii+1};type!='#{t.type}'&&(q='');type='#{t.type}'")= t.name
								.yui3-u(ng-hide="type=='inc'")
									input.newinput(placeholder='代码/名称', type='search', ng-model='q', name='q5', gf-textsearch='#demo5', focus-cls='lbc blurborder', autocomplete='off', line-height='18', offset='-2')
									dl#demo5.resultPanel(ng-show='products[type] && products[type].length')
										dd(ng-repeat='pro in products[type]')
											a(href='#', onclick='return false;', hidefocus="true", ng-click='$parent.q = pro[0];$parent.product={name: pro[0], code: pro[i], type: type};selectBiaodi(1, product, !temp);')
												span(ng-bind-html-unsafe='pro[0]+pro[i] | highlight : q : "highlight b"')

								.yui3-u.w102(ng-show="type=='inc'")
									a(href='#', onclick='return false;', hidefocus="true", gf-textsearch='#select7', gf-value='inc[index]', line-height='12', offset='-2').nostyle
										.yui3-u-19-24.padleft5.vam(ng-bind='inc[index].name')
										.yui3-u-5-24.toolspng.pic_6.vam
									dl#select7.resultPanel(style='min-width: 102px;')
										dd(ng-repeat='n in inc')
											a(href='#', onclick='return false;', hidefocus="true", ng-click="$parent.index=$index;$parent.product={name: n.name, code: n.stock_code, type: type};selectBiaodi(1, product, true);", ng-bind='n.name')

								.toolspng.pic_7(ng-show='_q', ng-click="q=''")

			.title
				.yui3-u.img
					.toolspng.pic_5
				.yui3-u.t
					.toolspng.pic_14.tac
						b.font14 选择对比时间段
				.yui3-u.l
					.btopdotted.mleft5(style='width: 530px')

			.selectone
				.container
					.referance.sfc
						a.yui3-u.selectbox.cp.w118.mleft25(href='#', onclick='return false;')
							.yui3-u-4-5
								input.newinput.date(gf-calendar, ng-model='begin_date', readonly, data-option="{handler: '#beginicon'}")
							.yui3-u-1-5
								#beginicon.mon-date-icon
						span.pad8 至
						a.yui3-u.selectbox.cp.w118(href='#', onclick='return false;')
							.yui3-u-4-5
								input.newinput.date(gf-calendar, ng-model='end_date', readonly, data-option="{handler: '#endicon'}")
							.yui3-u-1-5
								#endicon.mon-date-icon

				.padbottom20
					.btopdotted

				.editorItem.tac.padbottom50
					button.confirm(href='#', onclick='return false;', ng-click='analyse()') 开始分析

			.title
				.yui3-u.img
					.toolspng.pic_2
				.yui3-u.padleft5
					h3.font16.nomp 增长趋势曲线
			.padbottom50
				div(gf-chart='chartData', id='fundNetWorthchart')

			.title
				.yui3-u.img
					.toolspng.pic_3
				.yui3-u.padleft5
					h3.font16.nomp 组合基础信息

			.padtop8.padbottom30
				table(ng-init="types={fund: '基金', stocks: '股票'};")
					thead.font14
						tr
							td 产品简介
							td 产品代码
							td 产品类型
							td 比重
					tbody
						tr(ng-repeat='product in combinationTable', ng-class-even="'even'")
							td(ng-switch='!product.id')
								a.link(ng-switch-when='false', gf-href='#/{{product.product_type}}/detail?pid={{product.id}}', ng-bind='product.title')
								span(ng-switch-when='true', ng-bind='product.title')
							td(ng-bind='product.code')
							td(ng-bind='types[product.product_type]')
							td(ng-bind="product.ratio+'%'")